home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 3 / ct-rom iiib.zip / ct-rom iiib / WINDOWS / DIVERSEN / WINE02BX / ELISP.23 < prev    next >
Text File  |  1993-03-28  |  37KB  |  1,061 lines

  1. Info file elisp, produced by Makeinfo, -*- Text -*- from input file
  2. elisp.texi.
  3.  
  4.    This file documents GNU Emacs Lisp.
  5.  
  6.    This is edition 1.03 of the GNU Emacs Lisp Reference Manual,   for
  7. Emacs Version 18.
  8.  
  9.    Published by the Free Software Foundation, 675 Massachusetts
  10. Avenue,  Cambridge, MA 02139 USA
  11.  
  12.    Copyright (C) 1990 Free Software Foundation, Inc.
  13.  
  14.    Permission is granted to make and distribute verbatim copies of
  15. this manual provided the copyright notice and this permission notice
  16. are preserved on all copies.
  17.  
  18.    Permission is granted to copy and distribute modified versions of
  19. this manual under the conditions for verbatim copying, provided that
  20. the entire resulting derived work is distributed under the terms of a
  21. permission notice identical to this one.
  22.  
  23.    Permission is granted to copy and distribute translations of this
  24. manual into another language, under the above conditions for modified
  25. versions, except that this permission notice may be stated in a
  26. translation approved by the Foundation.
  27.  
  28.  
  29. 
  30. File: elisp,  Node: Building Emacs,  Next: Pure Storage,  Prev: GNU Emacs Internals,  Up: GNU Emacs Internals
  31.  
  32. Building Emacs
  33. ==============
  34.  
  35.    The first step in building Emacs is to compile the C sources. 
  36. This produces a program called `temacs', also called a "bare impure
  37. Emacs".  It contains the Emacs Lisp interpreter and I/O routines, but
  38. not the editing commands.
  39.  
  40.    Then, to create a working Emacs editor, issue the command `temacs
  41. -l loadup'.  This directs `temacs' to evaluate the Lisp files
  42. specified in the file `loadup.el'.  These files set up the normal
  43. Emacs editing environment, resulting in an Emacs which is still
  44. impure but no longer bare.
  45.  
  46.    It takes long time to load the standard Lisp files.  Luckily, you
  47. don't have to do this each time you run Emacs; `temacs' can dump out
  48. an executable program called `xemacs' which has these files
  49. preloaded.  `xemacs' starts more quickly because it does not need to
  50. load the files.  It is `xemacs' that is normally installed under the
  51. name `emacs' for users to run.
  52.  
  53.    To create `xemacs', use the command `temacs -batch -l loadup
  54. dump'.  The purpose of `-batch' here is to prevent `temacs' from
  55. trying to initialize any of its data on the terminal; this ensures
  56. that the tables of terminal information are empty in the dumped Emacs.
  57.  
  58.    When the `xemacs' executable is started, it will automatically
  59. load the user's `.emacs' file, or the default initialization file
  60. `default.el' if the user has none.  With the `.emacs' file, you can
  61. produce a version of Emacs that suits you and is not the same as the
  62. version other people use.  With `default.el', you can customize Emacs
  63. for all the users at your site who don't choose to customize it for
  64. themselves.  (For further reflection: why is this different from the
  65. case of the barber who shaves every man who doesn't shave himself?)
  66.  
  67.    On some systems, dumping does not work.  Then, you must start
  68. Emacs with the `temacs -l loadup' command each time you use it.  This
  69. takes a long time, but since you need to start Emacs once a day at
  70. most--and once a week or less frequently if you never log out--the
  71. extra time is not too severe a problem.
  72.  
  73.    Before `xemacs' is dumped, the documentation strings for primitive
  74. and preloaded functions (and variables) need to be found in the file
  75. where they are stored.  This is done by calling `Snarf-documentation'
  76. (*note Accessing Documentation::.).  These strings are omitted from
  77. `temacs' to save space.  *Note Documentation Basics::.
  78.  
  79.  * Function: dump-emacs TO-FILE FROM-FILE
  80.      This function dumps the current state of Emacs into an
  81.      executable file TO-FILE.  It takes symbols from FROM-FILE (this
  82.      is normally the executable file `temacs').
  83.  
  84.      If you use this function in an Emacs that was already dumped,
  85.      you must set `command-line-processed' to `nil' first for good
  86.      results.  *Note Command Line Arguments::.
  87.  
  88.  * Command: emacs-version
  89.      This function returns a string describing the version of Emacs
  90.      that is running.  It is useful to include this string in bug
  91.      reports.
  92.  
  93.           (emacs-version)
  94.             => "GNU Emacs 18.36.1 of Fri Feb 27 1987 on slug (berkeley-unix)"
  95.  
  96.      Called interactively, the function prints the same information
  97.      in the echo area.
  98.  
  99.  * Variable: emacs-build-time
  100.      The value of this variable is the time at which Emacs was built
  101.      at the local site.
  102.  
  103.           emacs-build-time
  104.                => "Fri Feb 27 14:55:57 1987"
  105.  
  106.  * Variable: emacs-version
  107.      The value of this variable is the version of Emacs being run. 
  108.      It is a string, e.g. `"18.36.1"'.
  109.  
  110.  
  111. 
  112. File: elisp,  Node: Pure Storage,  Next: Garbage Collection,  Prev: Building Emacs,  Up: GNU Emacs Internals
  113.  
  114. Pure Storage
  115. ============
  116.  
  117.    There are two types of storage in GNU Emacs Lisp for user-created
  118. Lisp objects: "normal storage" and "pure storage".  Normal storage is
  119. where all the new data which is created during an Emacs session is
  120. kept; see the following section for information on normal storage. 
  121. Pure storage is used for certain data in the preloaded standard Lisp
  122. files: data that should never change during actual use of Emacs.
  123.  
  124.    Pure storage is allocated only while `temacs' is loading the
  125. standard preloaded Lisp libraries.  In the file `xemacs', it is
  126. marked as read-only (on operating systems which permit this), so that
  127. the memory space can be shared by all the Emacs jobs running on the
  128. machine at once.  Pure storage is not expandable; a fixed amount is
  129. allocated when Emacs is compiled, and if that is not sufficient for
  130. the preloaded libraries, `temacs' crashes.  If that happens, you will
  131. have to increase the compilation parameter `PURESIZE' in the file
  132. `config.h'.  This normally won't happen unless you try to preload
  133. additional libraries or add features to the standard ones.
  134.  
  135.  * Function: purecopy OBJECT
  136.      This function makes a copy of OBJECT in pure storage and returns
  137.      it.  It copies strings by simply making a new string with the
  138.      same characters in pure storage.  It recursively copies the
  139.      contents of vectors and cons cells.  It does not make copies of
  140.      symbols, or any other objects, but just returns them unchanged. 
  141.      It signals an error if asked to copy markers.
  142.  
  143.      This function is used only while Emacs is being built and
  144.      dumped, and is called only in the file `emacs/lisp/loaddefs.el'.
  145.  
  146.  * Variable: pure-bytes-used
  147.      The value of this variable is the number of bytes of pure
  148.      storage allocated so far.  Typically, in a dumped Emacs, this
  149.      number is very close to the total amount of pure storage
  150.      available--if it were not, we would preallocate less.
  151.  
  152.  * Variable: purify-flag
  153.      This variable determines whether `defun' should make a copy of
  154.      the function definition in pure storage.  If it is non-`nil',
  155.      then the function definition is copied into pure storage.
  156.  
  157.      This flag is `t' while loading all of the basic functions for
  158.      building Emacs initially (allowing those functions to be
  159.      sharable and non-collectible).  It is set to `nil' when Emacs is
  160.      saved out as `xemacs'.  The flag is set and reset in the C
  161.      sources.
  162.  
  163.      You should not change this flag in a running Emacs.
  164.  
  165.  
  166. 
  167. File: elisp,  Node: Garbage Collection,  Next: Writing Emacs Primitives,  Prev: Pure Storage,  Up: GNU Emacs Internals
  168.  
  169. Garbage Collection
  170. ==================
  171.  
  172.    When a program creates a list or the user defines a new function
  173. (such as by loading a library), then that data is placed in normal
  174. storage.  If normal storage runs low, then Emacs asks the operating
  175. system to allocate more memory in blocks of 1k bytes.  Each block is
  176. used for one type of Lisp object, so symbols, cons cells, markers,
  177. etc. are segregated in distinct blocks in memory.  (Vectors, buffers
  178. and certain other editing types, which are fairly large, are
  179. allocated in individual blocks, one per object, while strings are
  180. packed into blocks of 8k bytes.)
  181.  
  182.    It is quite common to use some storage for a while, then release
  183. it by, for example, killing a buffer or deleting the last pointer to
  184. an object.  Emacs provides a "garbage collector" to reclaim this
  185. abandoned storage.  (This name is traditional, but "garbage recycler"
  186. might be a more intuitive metaphor for this facility.)
  187.  
  188.    The garbage collector operates by scanning all the objects that
  189. have been allocated and marking those that are still accessible to
  190. Lisp programs.  To begin with, all the symbols, their values and
  191. associated function definitions, and any data presently on the stack,
  192. are accessible.  Any objects which can be reached indirectly through
  193. other accessible objects are also accessible.
  194.  
  195.    When this is finished, all inaccessible objects are garbage.  No
  196. matter what the Lisp program or the user does, it is impossible to
  197. refer to them, since there is no longer a way to reach them.  Their
  198. space might as well be reused, since no one will notice.  That is
  199. what the garbage collector arranges to do.
  200.  
  201.    Unused cons cells are chained together onto a "free list" for
  202. future allocation; likewise for symbols and markers.  The accessible
  203. strings are compacted so they are contiguous in memory; then the rest
  204. of the space formerly occupied by strings is made available to the
  205. string creation functions.  Vectors, buffers, windows and other large
  206. objects are individually allocated and freed using `malloc'.
  207.  
  208.      Common Lisp note: unlike other Lisps, GNU Emacs Lisp does not
  209.      call the garbage collector when the free list is empty. 
  210.      Instead, it simply requests the operating system to allocate
  211.      more storage, and processing continues until `gc-cons-threshold'
  212.      bytes have been used.
  213.  
  214.      This means that you can make sure that the garbage collector
  215.      will not run during a certain portion of a Lisp program by
  216.      calling the garbage collector explicitly just before it
  217.      (provided that portion of the program does not use so much space
  218.      as to force a second garbage collection).
  219.  
  220.  * Command: garbage-collect
  221.      This command runs a garbage collection, and returns information
  222.      on the amount of space in use.  (Garbage collection can also
  223.      occur spontaneously if you use more than `gc-cons-threshold'
  224.      bytes of Lisp data since the previous garbage collection.)
  225.  
  226.      `garbage-collect' returns a list containing the following
  227.      information:
  228.  
  229.           ((USED-CONSES . FREE-CONSES)
  230.            (USED-SYMS . FREE-SYMS)
  231.            (USED-MARKERS . FREE-MARKERS)
  232.            USED-STRING-CHARS 
  233.            USED-VECTOR-SLOTS)
  234.           
  235.           (garbage-collect)
  236.                => ((3435 . 2332) (1688 . 0) (57 . 417) 24510 3839)
  237.  
  238.      Here is a table explaining each element:
  239.  
  240.     USED-CONSES
  241.           The number of cons cells in use.
  242.  
  243.     FREE-CONSES
  244.           The number of cons cells for which space has been obtained
  245.           from the operating system, but that are not currently being
  246.           used.
  247.  
  248.     USED-SYMS
  249.           The number of symbols in use.
  250.  
  251.     FREE-SYMS
  252.           The number of symbols for which space has been obtained
  253.           from the operating system, but that are not currently being
  254.           used.
  255.  
  256.     USED-MARKERS
  257.           The number of markers in use.
  258.  
  259.     FREE-MARKERS
  260.           The number of markers for which space has been obtained
  261.           from the operating system, but that are not currently being
  262.           used.
  263.  
  264.     USED-STRING-CHARS
  265.           The total size of all strings, in characters.
  266.  
  267.     USED-VECTOR-SLOTS
  268.           The total number of elements of existing vectors.
  269.  
  270.  * User Option: gc-cons-threshold
  271.      The value of this variable is the number of bytes of storage
  272.      that must be allocated for Lisp objects after one garbage
  273.      collection in order to request another garbage collection.  A
  274.      cons cell counts as eight bytes, a string as one byte per
  275.      character plus a few bytes of overhead, and so on.  (Space
  276.      allocated to the contents of buffers does not count.)  Note that
  277.      the new garbage collection does not happen immediately when the
  278.      threshold is exhausted, but only the next time the Lisp
  279.      evaluator is called.
  280.  
  281.      The initial threshold value is 100,000.  If you specify a larger
  282.      value, garbage collection will happen less often.  This reduces
  283.      the amount of time spent garbage collecting, but increases total
  284.      memory use.  You may want to do this when running a program
  285.      which creates lots of Lisp data.
  286.  
  287.      You can make collections more frequent by specifying a smaller
  288.      value, down to 10,000.  A value less than 10,000 will remain in
  289.      effect only until the subsequent garbage collection, at which
  290.      time `garbage-collect' will set the threshold back to 100,000.
  291.  
  292.  
  293. 
  294. File: elisp,  Node: Writing Emacs Primitives,  Next: Object Internals,  Prev: Garbage Collection,  Up: GNU Emacs Internals
  295.  
  296. Writing Emacs Primitives
  297. ========================
  298.  
  299.    Lisp primitives are Lisp functions implemented in C.  The details
  300. of interfacing the C function so that Lisp can call it are handled by
  301. a few C macros.  The only way to really understand how to write new C
  302. code is to read the source, but we can explain some things here.
  303.  
  304.    An example of a special form is the definition of `or', from
  305. `eval.c'.  (An ordinary function would have the same general
  306. appearance.)
  307.  
  308.      DEFUN ("or", For, Sor, 0, UNEVALLED, 0,
  309.        "Eval args until one of them yields non-NIL, then return that value.\n\
  310.      The remaining args are not evalled at all.\n\
  311.      If all args return NIL, return NIL.")
  312.        (args)
  313.           Lisp_Object args;
  314.      {
  315.        register Lisp_Object val;
  316.        Lisp_Object args_left;
  317.        struct gcpro gcpro1;
  318.      
  319.        if (NULL(args))
  320.          return Qnil;
  321.      
  322.        args_left = args;
  323.        GCPRO1 (args_left);
  324.      
  325.        do
  326.          {
  327.            val = Feval (Fcar (args_left));
  328.            if (!NULL (val))
  329.              break;
  330.            args_left = Fcdr (args_left);
  331.          }
  332.        while (!NULL(args_left));
  333.      
  334.        UNGCPRO;
  335.        return val;
  336.      }
  337.  
  338.    Let's start with a precise explanation of the arguments to the
  339. `DEFUN' macro:
  340.  
  341.   1. The first argument is the name of the Lisp symbol to define with
  342.      this function; it is `or'.
  343.  
  344.   2. The second argument is the C function name for this function. 
  345.      This is the name that is used in C code for calling the
  346.      function.  The name is, by convention, `F' prepended to the Lisp
  347.      name, with all dashes (`-') in the Lisp name changed to
  348.      underscores.  Thus, to call this function from C code, call
  349.      `For'.  Remember that the arguments must be of type
  350.      `Lisp_Object'; various macros and functions for creating values
  351.      of type `Lisp_Object' are declared in the file `lisp.h'.
  352.  
  353.   3. The third argument is a C variable name to use for a structure
  354.      that holds the data for the subr object that represents the
  355.      function in Lisp.  This structure conveys the Lisp symbol name
  356.      to the initialization routine that will create the symbol and
  357.      store the subr object as its definition.  By convention, this
  358.      name is the C function name with `F' replaced with `S'.
  359.  
  360.   4. The fourth argument is the minimum number of arguments that the
  361.      function requires.  In this case, no arguments are required.
  362.  
  363.   5. The fifth argument is the maximum number of arguments that the
  364.      function accepts.  Alternatively, it can be `UNEVALLED',
  365.      indicating a special form that receives unevaluated arguments. 
  366.      A function with the equivalent of an `&rest' argument would have
  367.      `MANY' in this position.  Both `UNEVALLED' and `MANY' are
  368.      macros.  This argument must be one of these macros or a number
  369.      at least as large as the fourth argument.
  370.  
  371.   6. The sixth argument is an interactive specification, a string
  372.      such as might be used as the argument of `interactive' in a Lisp
  373.      function.  In this case it is 0 (a null pointer), indicating
  374.      that this function cannot be called interactively.  A value of
  375.      `""' indicates an interactive function not taking arguments.
  376.  
  377.   7. The last argument is the documentation string.  It is written
  378.      just like a documentation string for a function defined in Lisp,
  379.      except you must write `\n\' at the end of each line.  In
  380.      particular, the first line should be a single sentence.
  381.  
  382.    After the call to the `DEFUN' macro, you must write the list of
  383. argument names that every C function must have, followed by ordinary
  384. C declarations for them.  Normally, all the arguments must be
  385. declared as `Lisp_Object'.  If the function has no upper limit on the
  386. number of arguments in Lisp, then in C it receives two arguments: the
  387. number of Lisp arguments, and the address of a block containing their
  388. values.  These have types `int' and `Lisp_Object *'.
  389.  
  390.    Within the function `For' itself, note the use of the macros
  391. `GCPRO1' and `UNGCPRO'.  `GCPRO1' is used to "protect" a variable
  392. from garbage collection--to inform the garbage collector that it must
  393. look in that variable and regard its contents as an accessible
  394. object.  This is necessary whenever you call `Feval' or anything that
  395. can directly or indirectly call `Feval'.  At such a time, any Lisp
  396. object that you intend to refer to again must be protected somehow. 
  397. `UNGCPRO' cancels the protection of the variables that are protected
  398. in the current function.  It is necessary to do this explicitly.
  399.  
  400.    For most data types, it suffices to know that one pointer to the
  401. object is protected; as long as the object is not recycled, all
  402. pointers to it remain valid.  This is not so for strings, because the
  403. garbage collector can move them.  When a string is moved, any
  404. pointers to it that the garbage collector does not know about will
  405. not be properly relocated.  Therefore, all pointers to strings must
  406. be protected across any point where garbage collection may be possible.
  407.  
  408.    The macro `GCPRO1' protects just one local variable.  If you want
  409. to protect two, use `GCPRO2' instead; repeating `GCPRO1' will not
  410. work.  There are also `GCPRO3' and `GCPRO4'.
  411.  
  412.    In addition to using these macros, you must declare the local
  413. variables such as `gcpro1' which they implicitly use.  If you protect
  414. two variables, with `GCPRO2', you must declare `gcpro1' and `gcpro2',
  415. as it uses them both.  Alas, we can't explain all the tricky details
  416. here.
  417.  
  418.    Defining the C function is not enough; you must also create the
  419. Lisp symbol for the primitive and store a suitable subr object in its
  420. function cell.  This is done by adding code to an initialization
  421. routine.  The code looks like this:
  422.  
  423.      defsubr (&SUBR-STRUCTURE-NAME);
  424.  
  425. SUBR-STRUCTURE-NAME is the name you used as the third argument to
  426. `DEFUN'.
  427.  
  428.    If you are adding a primitive to a file that already has Lisp
  429. primitives defined in it, find the function (near the end of the
  430. file) named `syms_of_SOMETHING', and add that function call to it. 
  431. If the file doesn't have this function, or if you create a new file,
  432. add to it a `syms_of_FILENAME' (e.g., `syms_of_myfile').  Then find
  433. the spot in `emacs.c' where all of these functions are called, and
  434. add a call to `syms_of_FILENAME' there.
  435.  
  436.    This function `syms_of_FILENAME' is also the place to define any C
  437. variables which are to be visible as Lisp variables.  `DEFVAR_LISP'
  438. is used to make a C variable of type `Lisp_Object' visible in Lisp. 
  439. `DEFVAR_INT' is used to make a C variable of type `int' visible in
  440. Lisp with a value that is an integer.
  441.  
  442.    Here is another function, with more complicated arguments.  This
  443. comes from the code for the X Window System, and it demonstrates the
  444. use of macros and functions to manipulate Lisp objects.
  445.  
  446.      DEFUN ("coordinates-in-window-p", Fcoordinates_in_window_p,
  447.        Scoordinates_in_window_p, 2, 2,
  448.        "xSpecify coordinate pair: \nXExpression which evals to window: ",
  449.        "Return non-nil if POSITIONS (a list, (SCREEN-X SCREEN-Y)) is in WINDOW.\n\  
  450.        Returned value is list of positions expressed\n\
  451.        relative to window upper left corner.")
  452.        (coordinate, window)
  453.           register Lisp_Object coordinate, window;
  454.      {
  455.        register Lisp_Object xcoord, ycoord;
  456.      
  457.        if (!CONSP (coordinate)) wrong_type_argument (Qlistp, coordinate);
  458.        CHECK_WINDOW (window, 2);
  459.        xcoord = Fcar (coordinate);
  460.        ycoord = Fcar (Fcdr (coordinate));
  461.        CHECK_NUMBER (xcoord, 0);
  462.        CHECK_NUMBER (ycoord, 1);
  463.        if ((XINT (xcoord) < XINT (XWINDOW (window)->left))
  464.            || (XINT (xcoord) >= (XINT (XWINDOW (window)->left)
  465.                                  + XINT (XWINDOW (window)->width))))
  466.          {
  467.            return Qnil;
  468.          }
  469.        XFASTINT (xcoord) -= XFASTINT (XWINDOW (window)->left);
  470.        if (XINT (ycoord) == (screen_height - 1))
  471.          return Qnil;
  472.        if ((XINT (ycoord) < XINT (XWINDOW (window)->top))
  473.            || (XINT (ycoord) >= (XINT (XWINDOW (window)->top)
  474.                                  + XINT (XWINDOW (window)->height)) - 1))
  475.          {
  476.            return Qnil;
  477.          }
  478.        XFASTINT (ycoord) -= XFASTINT (XWINDOW (window)->top);
  479.        return (Fcons (xcoord, Fcons (ycoord, Qnil)));
  480.      }
  481.  
  482.    Note that you cannot directly call functions defined in Lisp as,
  483. for example, the primitive function `Fcons' is called above.  You
  484. must create the appropriate Lisp form, protect everything from
  485. garbage collection, and `Feval' the form, as was done in `For' above.
  486.  
  487.    `eval.c' is a very good file to look through for examples;
  488. `lisp.h' contains the definitions for some important macros and
  489. functions.
  490.  
  491.  
  492. 
  493. File: elisp,  Node: Object Internals,  Prev: Writing Emacs Primitives,  Up: GNU Emacs Internals
  494.  
  495. Object Internals
  496. ================
  497.  
  498.    GNU Emacs Lisp manipulates many different types of data.  The
  499. actual data are stored in a heap and the only access that programs
  500. have to it is through pointers.  Pointers are thirty-two bits wide in
  501. most implementations.  Depending on the operating system and type of
  502. machine for which you compile Emacs, twenty-four to twenty-six bits
  503. are used to address the object, and the remaining six to eight bits
  504. are used for a tag that identifies the object's type.
  505.  
  506.    Because all access to data is through tagged pointers, it is
  507. always possible to determine the type of any object.  This allows
  508. variables to be untyped, and the values assigned to them to be
  509. changed without regard to type.  Function arguments also can be of
  510. any type; if you want a function to accept only a certain type of
  511. argument, you must check the type explicitly using a suitable
  512. predicate (*note Type Predicates::.).
  513.  
  514. * Menu:
  515.  
  516. * Buffer Internals::    Components of a buffer structure.
  517. * Window Internals::    Components of a window structure.
  518. * Process Internals::   Components of a process structure.
  519.  
  520.  
  521. 
  522. File: elisp,  Node: Buffer Internals,  Next: Window Internals,  Prev: Object Internals,  Up: Object Internals
  523.  
  524. Buffer Internals
  525. ----------------
  526.  
  527.    Buffers contain fields not directly accessible by the Lisp
  528. programmer.  We describe them here, naming them by the names used in
  529. the C code.  Many are accessible indirectly in Lisp programs via Lisp
  530. primitives.
  531.  
  532. `name'
  533.      The buffer name is a string which names the buffer.  It is
  534.      guaranteed to be unique.  *Note Buffer Names::.
  535.  
  536. `save_modified'
  537.      This field contains the time when the buffer was last saved, as
  538.      an integer.  *Note Buffer Modification::.
  539.  
  540. `modtime'
  541.      This field contains the modification time of the visited file. 
  542.      It is set when the file is written or read.  Every time the
  543.      buffer is written to the file, this field is compared to the
  544.      modification time of the file.  *Note Buffer Modification::.
  545.  
  546. `auto_save_modified'
  547.      This field contains the time when the buffer was last auto-saved.
  548.  
  549. `last_window_start'
  550.      This field contains the `window-start' position in the buffer as
  551.      of the last time the buffer was displayed in a window.
  552.  
  553. `undodata'
  554.      This field points to the buffer's undo stack.  *Note Undo::.
  555.  
  556. `syntax_table_v'
  557.      This field contains the syntax table for the buffer.  *Note
  558.      Syntax Tables::.
  559.  
  560. `markers'
  561.      This field contains the chain of all markers that point into the
  562.      buffer.  At each deletion or motion of the buffer gap, all of
  563.      these markers must be checked and perhaps updated.  *Note
  564.      Markers::.
  565.  
  566. `backed_up'
  567.      This field is a flag which tells whether a backup file has been
  568.      made for the visited file of this buffer.
  569.  
  570. `mark'
  571.      This field contains the mark for the buffer.  The mark is a
  572.      marker, hence it is also included on the list `markers'.  *Note
  573.      The Mark::.
  574.  
  575. `local_var_alist'
  576.      This field contains the association list containing all of the
  577.      variables local in this buffer, and their values.  A copy of
  578.      this list is returned by the function `buffer-local-variables'. 
  579.      *Note Buffer-Local Variables::.
  580.  
  581. `mode_line_format'
  582.      This field contains a Lisp object which controls how to display
  583.      the mode line for this buffer.  *Note Mode Line Format::.
  584.  
  585.  
  586. 
  587. File: elisp,  Node: Window Internals,  Next: Process Internals,  Prev: Buffer Internals,  Up: Object Internals
  588.  
  589. Window Internals
  590. ----------------
  591.  
  592.    Windows have the following accessible fields:
  593.  
  594. `height'
  595.      The height of the window, measured in lines.
  596.  
  597. `width'
  598.      The width of the window, measured in columns.
  599.  
  600. `buffer'
  601.      The buffer which the window is displaying.  This may change
  602.      often during the life of the window.
  603.  
  604. `start'
  605.      The position in the buffer which is the first character to be
  606.      displayed in the window.
  607.  
  608. `pointm'
  609.      This is the value of point in the current buffer when this
  610.      window is selected; when it is not selected, it retains its
  611.      previous value.
  612.  
  613. `left'
  614.      This is the left-hand edge of the window, measured in columns. 
  615.      (The leftmost column on the screen is column 0.)
  616.  
  617. `top'
  618.      This is the top edge of the window, measured in lines.  (The top
  619.      line on the screen is line 0.)
  620.  
  621. `next'
  622.      This is the window that is the next in the chain of siblings.
  623.  
  624. `prev'
  625.      This is the window that is the previous in the chain of siblings.
  626.  
  627. `force_start'
  628.      This is a flag which, if non-`nil', says that the window has
  629.      been scrolled explicitly by the Lisp program.  At the next
  630.      redisplay, if point is off the screen, instead of scrolling the
  631.      window to show the text around point, point will be moved to a
  632.      location that is on the screen.
  633.  
  634. `hscroll'
  635.      This is the number of columns that the display in the window is
  636.      scrolled horizontally to the left.  Normally, this is 0.
  637.  
  638. `use_time'
  639.      This is the last time that the window was selected.  This field
  640.      is used by `get-lru-window'.
  641.  
  642.  
  643. 
  644. File: elisp,  Node: Process Internals,  Prev: Window Internals,  Up: Object Internals
  645.  
  646. Process Internals
  647. -----------------
  648.  
  649.    The fields of a process are:
  650.  
  651. `name'
  652.      A string, the name of the process.
  653.  
  654. `command'
  655.      A list containing the command arguments that were used to start
  656.      this process.
  657.  
  658. `filter'
  659.      A function used to accept output from the process instead of a
  660.      buffer, or `nil'.
  661.  
  662. `sentinel'
  663.      A function called whenever the process receives a signal, or
  664.      `nil'.
  665.  
  666. `buffer'
  667.      The associated buffer of the process.
  668.  
  669. `pid'
  670.      An integer, the Unix process ID.
  671.  
  672. `childp'
  673.      A flag, non-`nil' if this is really a child process.  It is
  674.      `nil' for a network connection.
  675.  
  676. `flags'
  677.      A symbol indicating the state of the process.  Possible values
  678.      include `run', `stop', `closed', etc.
  679.  
  680. `reason'
  681.      An integer, the Unix signal number that the process received
  682.      that caused the process to terminate or stop.  If the process
  683.      has exited, then this is the exit code it specified.
  684.  
  685. `mark'
  686.      A marker indicating the position of end of last output from this
  687.      process inserted into the buffer.  This is usually the end of
  688.      the buffer.
  689.  
  690. `kill_without_query'
  691.      A flag, non-`nil' meaning this process should not cause
  692.      confirmation to be needed if Emacs is killed.
  693.  
  694.  
  695. 
  696. File: elisp,  Node: Standard Errors,  Next: Standard Buffer-Local Variables,  Prev: GNU Emacs Internals,  Up: Top
  697.  
  698. Standard Errors
  699. ***************
  700.  
  701.    Here is the complete list of the error symbols in standard Emacs,
  702. grouped by concept.  The list includes each symbol's message (on the
  703. `error-message' property of the symbol), and a cross reference to a
  704. description of how the error can occur.
  705.  
  706.    Each error symbol has an `error-conditions' property which is a
  707. list of symbols.  Normally, this list includes the error symbol
  708. itself, and the symbol `error'.  Occasionally it includes additional
  709. symbols, which are intermediate classifications, narrower than
  710. `error' but broader than a single error symbol.  For example, all the
  711. errors in accessing files have the condition `file-error'.
  712.  
  713.    As a special exception, the error symbol `quit' does not have the
  714. condition `error', because quitting is not considered an error.
  715.  
  716.    *Note Errors::, for an explanation of how errors are generated and
  717. handled.
  718.  
  719. `SYMBOL'
  720.      STRING; REFERENCE.
  721.  
  722. `error'
  723.      `"error"'; see `error' in *Note Errors::.
  724.  
  725. `quit'
  726.      `"Quit"'; see *Note Quitting::.
  727.  
  728. `args-out-of-range'
  729.      `"Args out of range"'; see *Note Sequences Arrays Vectors::.
  730.  
  731. `arith-error'
  732.      `"Arithmetic error"'; see `/' and `%' in *Note Numbers::.
  733.  
  734. `beginning-of-buffer'
  735.      `"Beginning of buffer"'; see *Note Motion::.
  736.  
  737. `buffer-read-only'
  738.      `"Buffer is read-only"'; see *Note Read Only Buffers::.
  739.  
  740. `end-of-buffer'
  741.      `"End of buffer"'; see *Note Motion::.
  742.  
  743. `end-of-file'
  744.      `"End of file during parsing"'; see *Note Input Functions::. 
  745.      This is not a `file-error'.
  746.  
  747. `file-error'
  748.      *Note Files::.  This error, and its subcategories, do not have
  749.      error-strings, because the error message is constructed from the
  750.      data items alone when the error condition `file-error' is present.
  751.  
  752. `file-locked'
  753.      *Note File Locks::.  This is a `file-error'.
  754.  
  755. `file-already-exists'
  756.      *Note Writing to Files::.  This is a `file-error'.
  757.  
  758. `file-supersession'
  759.      *Note Buffer Modification::.  This is a `file-error'.
  760.  
  761. `invalid-function'
  762.      `"Invalid function"'; see *Note Classifying Lists::.
  763.  
  764. `invalid-read-syntax'
  765.      `"Invalid read syntax"'; see *Note Input Functions::.
  766.  
  767. `invalid-regexp'
  768.      `"Invalid regexp"'; see *Note Regular Expressions::.
  769.  
  770. `no-catch'
  771.      `"No catch for tag"'; see *Note Catch and Throw::.
  772.  
  773. `search-failed'
  774.      `"Search failed"'; see *Note Searching and Matching::.
  775.  
  776. `setting-constant'
  777.      `"Attempt to set a constant symbol"'; the values of the symbols
  778.      `nil' and `t' may not be changed.
  779.  
  780. `void-function'
  781.      `"Symbol's function definition is void"';
  782.       see *Note Function Cells::.
  783.  
  784. `void-variable'
  785.      `"Symbol's value as variable is void"';
  786.       see *Note Accessing Variables::.
  787.  
  788. `wrong-number-of-arguments'
  789.      `"Wrong number of arguments"'; see *Note Classifying Lists::.
  790.  
  791. `wrong-type-argument'
  792.      `"Wrong type argument"'; see *Note Type Predicates::.
  793.  
  794.  
  795. 
  796. File: elisp,  Node: Standard Buffer-Local Variables,  Next: Standard Keymaps,  Prev: Standard Errors,  Up: Top
  797.  
  798. Standard Buffer-Local Variables
  799. *******************************
  800.  
  801.    The table below shows all of the variables that are automatically
  802. local (when set) in each buffer in Emacs Version 18 with the common
  803. packages loaded.
  804.  
  805. `abbrev-mode'
  806.      *Note Abbrevs::.
  807.  
  808. `auto-fill-hook'
  809.      *Note Auto Filling::.
  810.  
  811. `buffer-auto-save-file-name'
  812.      *Note Auto-Saving::.
  813.  
  814. `buffer-backed-up'
  815.      *Note Backup Files::.
  816.  
  817. `buffer-file-name'
  818.      *Note Buffer File Name::.
  819.  
  820. `buffer-read-only'
  821.      *Note Read Only Buffers::.
  822.  
  823. `buffer-saved-size'
  824.      *Note Point::.
  825.  
  826. `case-fold-search'
  827.      *Note Searching and Case::.
  828.  
  829. `ctl-arrow'
  830.      *Note Control Char Display::.
  831.  
  832. `default-directory'
  833.      *Note System Environment::.
  834.  
  835. `fill-column'
  836.      *Note Auto Filling::.
  837.  
  838. `left-margin'
  839.      *Note Indentation::.
  840.  
  841. `local-abbrev-table'
  842.      *Note Abbrevs::.
  843.  
  844. `major-mode'
  845.      *Note Mode Help::.
  846.  
  847. `mark-ring'
  848.      *Note The Mark::.
  849.  
  850. `minor-modes'
  851.      *Note Minor Modes::.
  852.  
  853. `mode-name'
  854.      *Note Mode Line Variables::.
  855.  
  856. `overwrite-mode'
  857.      *Note Insertion::.
  858.  
  859. `paragraph-separate'
  860.      *Note Standard Regexps::.
  861.  
  862. `paragraph-start'
  863.      *Note Standard Regexps::.
  864.  
  865. `require-final-newline'
  866.      *Note Insertion::.
  867.  
  868. `selective-display'
  869.      *Note Selective Display::.
  870.  
  871. `selective-display-ellipses'
  872.      *Note Selective Display::.
  873.  
  874. `tab-width'
  875.      *Note Control Char Display::.
  876.  
  877. `truncate-lines'
  878.      *Note Truncation::.
  879.  
  880.  
  881. 
  882. File: elisp,  Node: Standard Keymaps,  Next: Standard Hooks,  Prev: Standard Buffer-Local Variables,  Up: Top
  883.  
  884. Standard Keymaps
  885. ****************
  886.  
  887.    The following symbols are used as the names for various keymaps. 
  888. Some of these exist when Emacs is first started, others are only
  889. loaded when their respective mode is used.  This is not an exhaustive
  890. list.
  891.  
  892.    Almost all of these maps are used as local maps.  Indeed, of the
  893. modes that presently exist, only Vip mode and Terminal mode ever
  894. change the global keymap.
  895.  
  896. `Buffer-menu-mode-map'
  897.      A full keymap used by Buffer Menu mode.
  898.  
  899. `c-mode-map'
  900.      A sparse keymap used in C mode as a local map.
  901.  
  902. `command-history-map'
  903.      A full keymap used by Command History mode.
  904.  
  905. `ctl-x-4-map'
  906.      A sparse keymap for subcommands of the prefix `C-x 4'.
  907.  
  908. `ctl-x-map'
  909.      A full keymap for `C-x' commands.
  910.  
  911. `debugger-mode-map'
  912.      A full keymap used by Debugger mode.
  913.  
  914. `dired-mode-map'
  915.      A full keymap for `dired-mode' buffers.
  916.  
  917. `doctor-mode-map'
  918.      A sparse keymap used by Doctor mode.
  919.  
  920. `edit-abbrevs-map'
  921.      A sparse keymap used in `edit-abbrevs'.
  922.  
  923. `edit-tab-stops-map'
  924.      A sparse keymap used in `edit-tab-stops'.
  925.  
  926. `electric-buffer-menu-mode-map'
  927.      A full keymap used by Electric Buffer Menu mode.
  928.  
  929. `electric-history-map'
  930.      A full keymap used by Electric Command History mode.
  931.  
  932. `emacs-lisp-mode-map'
  933.      A sparse keymap used in Emacs Lisp mode.
  934.  
  935. `function-keymap'
  936.      The keymap for the definitions of keypad and function keys.
  937.        If there are none, then it contains an empty sparse keymap.
  938.  
  939. `fundamental-mode-map'
  940.      The local keymap for Fundamental mode.
  941.        It is empty and should not be changed.
  942.  
  943. `Helper-help-map'
  944.      A full keymap used by the help utility package.
  945.        It has the same keymap in its value cell and in its function
  946.      cell.
  947.  
  948. `Info-edit-map'
  949.      A sparse keymap used by the `e' command of Info.
  950.  
  951. `Info-mode-map'
  952.      A sparse keymap containing Info commands.
  953.  
  954. `lisp-interaction-mode-map'
  955.      A sparse keymap used in Lisp mode.
  956.  
  957. `lisp-mode-map'
  958.      A sparse keymap used in Lisp mode.
  959.  
  960. `mode-specific-map'
  961.      The keymap for characters following `C-c'.  Note, this is in the
  962.      global map.  This map is not actually mode specific: its name
  963.      was chosen to be informative for the user in `C-h b'
  964.      (`display-bindings'), where it describes the main use of the
  965.      `C-c' prefix key.
  966.  
  967. `mouse-map'
  968.      A sparse keymap for mouse commands from the X Window System.
  969.  
  970. `occur-mode-map'
  971.      A local keymap used in Occur mode.
  972.  
  973. `text-mode-map'
  974.      A sparse keymap used by Text mode.
  975.  
  976. `view-mode-map'
  977.      A full keymap used by View mode.
  978.  
  979.  
  980. 
  981. File: elisp,  Node: Standard Hooks,  Next: Index,  Prev: Standard Keymaps,  Up: Top
  982.  
  983. Standard Hooks
  984. **************
  985.  
  986.    The following is a list of hooks available with the distributed
  987. 18.52 version of GNU Emacs.  Some of these hooks are called with
  988. `run-hooks' and can be a list of functions.  Others are not called
  989. with `run-hooks' and may or may not allow a list of functions.  For
  990. example, the `suspend-hook' can only reference a single function. 
  991. *Note Hooks::, for more information about using hooks.
  992.  
  993.      *Note:* in version 19, `blink-paren-hook' and `auto-fill-hook'
  994.      are renamed to `blink-paren-function' and `auto-fill-function'
  995.      respectively, since they are not called by the `run-hooks'
  996.      function.
  997.  
  998. `auto-fill-hook'
  999. `blink-paren-hook'
  1000. `c-mode-hook'
  1001. `command-history-hook'
  1002. `comment-indent-hook'
  1003. `define-hooked-global-abbrev'
  1004. `define-hooked-local-abbrev'
  1005. `dired-mode-hook'
  1006. `disabled-command-hook'
  1007. `edit-picture-hook'
  1008. `electric-buffer-menu-mode-hook'
  1009. `electric-command-history-hook'
  1010. `electric-help-mode-hook'
  1011. `emacs-lisp-mode-hook'
  1012. `find-file-hooks'
  1013. `find-file-not-found-hooks'
  1014. `fortran-comment-hook'
  1015. `fortran-mode-hook'
  1016. `ftp-setup-write-file-hooks'
  1017. `ftp-write-file-hook'
  1018. `indent-mim-hook'
  1019. `LaTeX-mode-hook'
  1020. `ledit-mode-hook'
  1021. `lisp-indent-hook'
  1022. `lisp-interaction-mode-hook'
  1023. `lisp-mode-hook'
  1024. `m2-mode-hook'
  1025. `mail-mode-hook'
  1026. `mail-setup-hook'
  1027. `medit-mode-hook'
  1028. `mh-compose-letter-hook'
  1029. `mh-folder-mode-hook'
  1030. `mh-letter-mode-hook'
  1031. `mim-mode-hook'
  1032. `news-mode-hook'
  1033. `news-reply-mode-hook'
  1034. `news-setup-hook'
  1035. `nroff-mode-hook'
  1036. `outline-mode-hook'
  1037. `plain-TeX-mode-hook'
  1038. `prolog-mode-hook'
  1039. `protect-innocence-hook'
  1040. `rmail-edit-mode-hook'
  1041. `rmail-mode-hook'
  1042. `rmail-summary-mode-hook'
  1043. `scheme-indent-hook'
  1044. `scheme-mode-hook'
  1045. `scribe-mode-hook'
  1046. `shell-mode-hook'
  1047. `shell-set-directory-error-hook'
  1048. `suspend-hook'
  1049. `suspend-resume-hook'
  1050. `temp-buffer-show-hook'
  1051. `term-setup-hook'
  1052. `terminal-mode-hook'
  1053. `terminal-mode-break-hook'
  1054. `TeX-mode-hook'
  1055. `text-mode-hook'
  1056. `vi-mode-hook'
  1057. `view-hook'
  1058. `write-file-hooks'
  1059. `x-process-mouse-hook'
  1060.  
  1061.